<?xml version="1.0" encoding="UTF-8"?>

<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>

<AnchorPane xmlns="http://javafx.com/javafx"
            xmlns:fx="http://javafx.com/fxml"
            fx:controller="CancMachingSynhioDetailHtml"
            prefHeight="400.0" prefWidth="600.0">

</AnchorPane>
        <!DOCTYPE html>
<html>
<!--已经完成了打印，数据的封装，只需将函数放入请求成功里面即可-->

<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../lib/layui/css/layui.css" />
</head>

<body>

    <div class="canc-assessmentForm" id="print-area">

        <!--<button class="noprint">预览</button>-->
        <button class="noprint" onclick="print()">打印</button>
        <!--startprint-->
        <div class="canc-assessmentForm-title">

            <h2>空管系统空中交通管制专业岗前统一培训</h2>
            <h2>机场管制基础模拟机考核评估表</h2>
        </div>
        <div>模拟机实操记录编号:<input type="text" class="operationTypeId" /></div>
        <!--表格部分 colspan是横向合并；rowspan是纵向合并。-->
        <div class="canc-assessmentForm-table" id="tableBox">
            <table border="" cellspacing="" cellpadding="" class="assessmentForm-table-table" style="border-collapse:collapse">
                <tr class="assessmentForm-table-tr">
                    <td class="table-tr1 studentName" rowspan="2" colspan="3">姓名</td>
                    <!--<td class="table-tr1" rowspan="2"></td>-->
                    <td class="table-tr1" rowspan="2" colspan="3"><input type="text" name="userName" id="userName" class="inp-data userName" /></td>
                    <td class="table-tr1" rowspan="2" colspan="3">练习编号</td>
                    <td class="table-tr2" rowspan="2" colspan="2"><input type="text" name="number" id="number" class="inp-data number" /></td>
                    <td class="table-tr1" rowspan="2" colspan="3">日期</td>
                    <td class="table-tr3" rowspan="2" colspan="4"><input type="text" name="date" id="date" class="inp-data date" /></td>
                    <td class="table-tr1" rowspan="2" colspan="3">练习时间</td>
                    <td class="table-tr3" rowspan="2" colspan="4"><input type="text" name="time" id="time" class="inp-data time" /></td>
                </tr>
                <tr class="assessmentForm-table-tr">
                    <!--合并了-->
                </tr>
                <tr class="assessmentForm-table-tr">
                    <td class="table-tr4" colspan="3">评估项目</td>
                    <td class="table-tr5" colspan="8">评估内容</td>
                    <td class="table-tr6" colspan="5">项目评估得分</td>
                    <td class="table-tr7" colspan="9">注释</td>
                </tr>
                <tr class="assessmentForm-table-tr guanzhi">

                    <td class="table-tr8 title" rowspan="" colspan="3">管制效率<span class='qunzhong'></span></td>
                    <td class="table-tr9 tr_e_first" colspan="8"></td>
                    <td class="table-tr9 star" colspan="5">
                        <!--<i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>
                        <i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>
                        <i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>
                        <i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>
                        <i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>-->
                    </td>
                    <td class="table-tr7" colspan="9"><input type="text" name="comments" class="inp-data comments_1" /></td>
                </tr>

                <!--规则-->
                <tr class="assessmentForm-table-tr yisi">

                    <td class="table-tr8 title" rowspan="" colspan="3">管制意识<span class='qunzhong'></span></td>
                    <td class="table-tr9 tr_e_first" colspan="8"></td>
                    <td class="table-tr9 star" colspan="5">
                        <!--<i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>
                        <i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>
                        <i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>
                        <i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>
                        <i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>-->
                    </td>
                    <td class="table-tr7" colspan="9"><input type="text" name="comments" class="inp-data comments_1" /></td>
                </tr>
                <tr class="assessmentForm-table-tr rule">

                    <td class="table-tr8 title" rowspan="" colspan="3">管制规则<span class='qunzhong'></span></td>
                    <td class="table-tr9 tr_e_first" colspan="8"></td>
                    <td class="table-tr9 star" colspan="5">
                        <!--<i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>
                        <i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>
                        <i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>
                        <i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>
                        <i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>-->
                    </td>
                    <td class="table-tr7" colspan="9"><input type="text" name="comments" class="inp-data comments_1" /></td>
                </tr>
                <tr class="assessmentForm-table-tr talking">

                    <td class="table-tr8 title" rowspan="" colspan="3">标准普通话通话<span class='qunzhong'></span></td>
                    <td class="table-tr9 tr_e_first" colspan="8"></td>
                    <td class="table-tr9 star" colspan="5">
                        <!--<i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>
                        <i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>
                        <i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>
                        <i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>
                        <i class="layui-icon layui-icon-rate trStart" style="font-size: 20px; color: #1E9FFF;"></i>-->
                    </td>
                    <td class="table-tr7" colspan="9"><input type="text" name="comments" class="inp-data comments_1" /></td>
                </tr>

                <tr class="assessmentForm-table-tr">
                    <td class="table-tr1" rowspan="3" colspan="3">项目说明</td>
                    <td class="table-tr10" colspan="22" rowspan="3">考核项目共分为5类，18个分项，除前三项，满分为10分，、13分和14分每项满分为满分2.5分外，其他13项每项满分为5分，考核项目共分为5类，18个分项，除前三项，满分为10分，、13分和14分每项满分为满分2.5分外，其他13项每项满分为5分，</td>
                </tr>
                <tr class="assessmentForm-table-tr">
                    <!--合并了-->
                </tr>
                <tr class="assessmentForm-table-tr">
                    <!--合并了-->
                </tr>
                <tr class="assessmentForm-table-tr">
                    <td class="table-tr1" colspan="3">总评成绩</td>
                    <td class="table-tr11" colspan="22"><input type="text" name="totalScore" id="totalScore" class="inp-data totalScore" /></td>
                </tr>
                <tr class="assessmentForm-table-tr">
                    <td class="table-tr12" colspan="25">总体评价：<input type="text" name="comment" id="comment" class="inp-data comment" /></td>
                </tr>
                <tr class="assessmentForm-table-tr table-footer">
                    <td class="table-tr1" colspan="6">学员签字</td>
                    <td class="table-tr1" colspan="6"><input type="text" name="studentSign" id="studentSign" class="inp-data studentSign" /></td>
                    <td class="table-tr1" colspan="6">教员签字</td>
                    <td class="table-tr1" colspan="7"><input type="text" name="teacherSign" id="teacherSign" class="inp-data teacherSign" /></td>
                </tr>
                <tr class="assessmentForm-table-tr footer" id="footer">

                </tr>

            </table>
        </div>
    </div>
    <!--endprint-->
    <script src="../../static/js/jquery.1.11.1.js"></script>

    <script src="js/jquery.jqprint-0.3.js"></script>
    <script src="../../static/js/public.js"></script>

    <script src="../../lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
    <script>
        //			测试实操课详情

        //
        //"systoken": 全局token,
        //"id": 模拟机实操记录编号,
        //"is_used": 是否有效 0:有效 1:无效,
        //"stamp": 时间戳,
        //"version": 数据版本 :默认0,
        //"visit_plat": 访问平台 0:网页 1:pad,
        //"visit_type": 访问类型 0:测试 1:生产,

        // queryClasses();

        function queryClasses() {

            var id=$(".operationTypeId").val();//id
            var stamp = new Date().getTime(); //数据时间戳

            var version = 0; //数据版本 (int),
            var visit_plat = 0; //访问平台 (int),
            var visit_type = 0; //访问类型 (int),
            var is_used = 0; // 数据是否有效 0有效1失效 (int)
            var systoken = sessionStorage.getItem('systoken');

            var param = {

                id: id,
                stamp: stamp,
                version: version,
                visit_plat: visit_plat,
                visit_type: visit_type,
                is_used: is_used,
                systoken: systoken

            }
            param = JSON.stringify(param);
            var url = path + "/operationRecords/getDetail"

            $.ajax({
                url: url,
                type: "post",
                data: {
                    param: param
                },
                headers: {
                    Authorization: systoken
                },
                dataType: "json",
                success: function(res) {

                }
            })
        }

        var res = {
            "status": "000",
            "info": "成功",
            "rows": [{
            "rule": [
                ["11正确实施程序和方法", 9, "标准1", "1"],
                ["12保持高效工作", 4, "标准2", "2"],
                ["13发布管制指令", 5, "标准3", "3"],
                ["14设备状态并获取信息", 5, "标准4", "4"],
                ["15正确使用和调整设备", 5, "标准5", "5"], "25%"
            ],
            "consciousness": [
                ["11正确实施程序和方法", 9, "标准1", "1"],
                ["12保持高效工作", 4, "标准2", "2"],
                ["13发布管制指令", 5, "标准3", "3"],
                ["14设备状态并获取信息", 5, "标准4", "4"],
                ["15正确使用和调整设备", 5, "标准5", "5"], "25%"
            ],
            "efficiency": [
                ["11正确实施程序和方法", 8, "标准1", "1"],
                ["12保持高效工作", 4, "标准2", "2"],
                ["13发布管制指令", 5, "标准3", "3"],
                ["14设备状态并获取信息", 5, "标准4", "4"],
                ["15正确使用和调整设备", 5, "标准5", "5"], "25%"
            ],
            "talking": [
                ["11正确实施程序和方法", 8, "标准1", "1"],
                ["12保持高效工作", 4, "标准2", "2"],
                ["13发布管制指令", 5, "标准3", "3"],
                ["14设备状态并获取信息", 5, "标准4", "4"],
                ["15正确使用和调整设备", 5, "标准5", "5"], "25%"
            ],
            "studentSign": "https://res.kdzydev.cn/eb0fbb9afc264652bd5e311afbcb1b4c_studentSign.jpg",
            "teacherSign": "https://res.kdzydev.cn/9541f31625f942808191e06101cf2c82_teacherSign.jpg",
            "practiceTime": "14:44:32",
            "practiceDate": "2018-12-04",
            "studentName": "test",
            "teacherName": "系统管理员"
            }]
        };

        function setTable(efficiency, $el) {
            var efficiency = res.rows[0].efficiency;
            //						赋值权重
            $(".qunzhong").text(efficiency[efficiency.length - 1]);

            var rowsLength = efficiency.length - 1;
            //						首个tr rowspan
            $(".title").attr("rowspan", rowsLength);
            //							管制效率
            var first = efficiency[0];
            $(".tr_e_first").text(efficiency[0][0]);
            var starLength = efficiency[0][1];

            var starLength = first[1];
            var $i;
            var firstStar = efficiency[0][1] + '分';
            $(".star").text(firstStar);
            //			for(var i = 0; i < starLength; i++) {
            //				$(".star").append($("<i class='layui-icon layui-icon-rate trStart' style='font-size: 20px; color: #1E9FFF;'></i>"));
            //			}
            $(".comments_1").val(efficiency[0][2]);

            for(var i = efficiency.length - 2; i > 0; i--) {

                var $sonModel = $("<tr class='assessmentForm-table-tr'>" +
                "<td class='table-tr9' colspan='8'>" + efficiency[i][0] + "</td>" +
                "<td class='table-tr9' colspan='5'>" + efficiency[i][1] + '分' +
                "</td>" +
                "<td class='table-tr7' colspan='9'><input type='text' " + "value=" + efficiency[i][2] + " name='comments' class='inp-data comments'/></td>" + "< /tr>");

                $el.after($sonModel)
            }
        }
        var efficiency = res.rows[0].efficiency;
        var consciousness = res.rows[0].consciousness;
        var rule = res.rows[0].rule;
        var talking = res.rows[0].talking;

        setTable(efficiency, $el = $(".guanzhi"));
        setTable(consciousness, $el = $(".yisi"));
        setTable(rule, $el = $(".rule"));
        setTable(talking, $el = $(".talking"));
        //			打印函数
        function doPrint() {
            bdhtml = window.document.body.innerHTML;
            sprnstr = "<!--startprint-->";
            eprnstr = "<!--endprint-->";
            prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17);
            prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
            window.document.body.innerHTML = prnhtml;
            window.print();
        }

        function print() {
            $("#print-area").jqprint({
                debug: false,
                importCSS: true,
                printContainer: true,
                operaSupport: false
            });
        }

    </script>
</body>

</html>